package reply

// 为啥一下要new 一下又是返回结构体的  特地new一个的目的是啥

// Pong
type PongReply struct{}
func (r *PongReply) ToBytes() []byte {
	return []byte("+PONG\r\n")
}
//OK
type OkReply struct{}
func MakeOkReply() *OkReply {
	return &OkReply{}
}
func (r *OkReply) ToBytes() []byte {
	return []byte("+OK\r\n")
}

// NullBulk
type NullBulkReply struct{}
func (r *NullBulkReply) ToBytes() []byte {
	return []byte("$-1\r\n")
}
func MakeNullBulkReply() *NullBulkReply {
	return &NullBulkReply{}
}

// EmptyMultiBulkReply
type EmptyMultiBulkReply struct{}
func (r *EmptyMultiBulkReply) ToBytes() []byte {
	return []byte("*0\r\n")
}
func MakeEmptyMultiBulkReply() *EmptyMultiBulkReply {
	return &EmptyMultiBulkReply{}
}

// NoReply
type NoReply struct{}
func (r *NoReply) ToBytes() []byte {
	return []byte("")
}

// QueuedReply is +QUEUE
type QueuedReply struct{}
func (r *QueuedReply) ToBytes() []byte {
	return []byte("+QUEUED\r\n")
}
func MakeQueuedReply() *QueuedReply {
	return &QueuedReply{}
}
